﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admincenter/AdminPage.master" AutoEventWireup="true" CodeFile="CategoryManager.aspx.cs" Inherits="admincenter_CategoryManager" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" RenderMode="Block">
        <ContentTemplate>
            <!-- Add / Update Category -->
            <div class="row">
                <div class="col-lg-12">
                    <h1>
                        Quản lý chuyên mục</h1>
                    <ol class="breadcrumb">
                        <li><i class="fa fa-dashboard"></i> Bảng điều khiển</li>
                        <li class="active"><i class="fa fa-table"></i> Quản lý chuyên mục</li>
                    </ol>
                </div>
                <!-- Loai Phuong tien -->
                <div class="col-lg-12">
                    <div class="panel panel-primary">
                        <div class="panel-heading">
                            <h3 class="panel-title">
                                <i class="fa fa-table"></i> Thêm các chuyên mục mới</h3>
                        </div>
                        <div class="panel-body">
                            <div class="form-group">
                                <asp:HiddenField runat="server" ID="hiddenId" EnableViewState="False"/>
                                <asp:Panel runat="server" ID="panelTrangthai" Visible="False" EnableViewState="False">
                                    <asp:Literal runat="server" ID="litResult" EnableViewState="False"></asp:Literal>
                                </asp:Panel>
                                <label>
                                    Mã chuyên mục</label>
                                <p>
                                    <asp:TextBox CssClass="form-control" runat="server" ID="tbId" placeholder="Mã chuyên mục" MaxLength="100"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" SetFocusOnError="True"
                                        ControlToValidate="tbId" Display="Dynamic" ErrorMessage="(*) Chưa nhập dữ liệu"
                                        ValidationGroup="groupAddUpdatePT"></asp:RequiredFieldValidator>
                                </p>
                                <label>
                                    Tên chuyên mục</label>
                                <p>
                                    <asp:TextBox CssClass="form-control" runat="server" ID="tbName" placeholder="Nhập tên chuyên mục" MaxLength="200"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" SetFocusOnError="True"
                                        ControlToValidate="tbName" Display="Dynamic" ErrorMessage="(*) Chưa nhập dữ liệu"
                                        ValidationGroup="groupAddUpdatePT"></asp:RequiredFieldValidator>
                                </p>
                                <label>
                                    Sử dụng</label>
                                <p>
                                    <asp:CheckBox CssClass="form-control" runat="server" ID="cbTrangThai" ToolTip="Trạng thái sử dụng" />
                                </p>
                                <p>
                                    <button type="reset" class="btn btn-default">
                                        Xóa</button>
                                    <asp:Button runat="server" CssClass="btn btn-primary" ID="btnThemvao" Text="Thêm vào"
                                        OnClick="btnThemVao_OnClick" />
                                </p>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- end Loai Phuong tien -->
                <div class="col-lg-12">
                    <div class="panel panel-primary">
                        <div class="panel-heading">
                            <h3 class="panel-title">
                                <i class="fa fa-table"></i> Danh sách các chuyên mục</h3>
                        </div>
                        <div class="panel-body">
                            <asp:GridView CssClass="table table-bordered" ID="gv" DataKeyNames="Id"
                                runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" PageSize="5"
                                AllowPaging="true" PagerSettings-Position="TopAndBottom" OnPageIndexChanging="gv_PageIndexChanging"
                                PagerSettings-PageButtonCount="5" AllowSorting="true" OnSorting="gv_Sorting" OnRowCommand="gv_RowCommand"                               
                                EmptyDataText="Chưa cập nhật dữ liệu" AutoGenerateEditButton="True">
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:LinkButton runat="server" ID="lbEdit" CommandArgument='<%#Eval("Id") %>' 
                                            OnCommand="lbEdit_OnCommand" CommandName="Edit" Text="Edit"></asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <AlternatingRowStyle BackColor="White" />
                                <FooterStyle BackColor="#d02027" Font-Bold="True" ForeColor="Black" />
                                <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" />
                                <PagerStyle CssClass="phan-trang" BackColor="#428bca" ForeColor="#ffffff" HorizontalAlign="Center" />
                                <RowStyle BackColor="#FFFBD6" ForeColor="#333333" VerticalAlign="Middle" Wrap="True" />
                                <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                                <PagerSettings Mode="NumericFirstLast"></PagerSettings>                                
                            </asp:GridView>
                        </div>
                    </div>
                </div>
            </div>
            <!-- end Add / Update Loai phuong tien -->
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

